function train_add_back(){
		$("#train_add").hide();
		$("#train_list").fadeIn();
	
}

function trainSave(){
	var tcourse = $("#train_add_course").val();
	var tcher= $("#train_add_teacher").val();
	var tstu = $("#train_add_student").val();
	var tdate = $("#train_add_date").val();
	var ttime = $("#train_add_time").val();
	var tplace =$("#train_add_place").val();
	
	if(tcourse == ""){
		$("#train_add_error").html("课程不能为空！");
		return ;
	}
	if(tcher == ""){
		$("#train_add_error").html("讲师不能为空!");
		return ;
	}
	if(tstu == ""){
		$("#train_add_error").html("学员不能为空!");
		return ;
	}
	if(tplace == ""){
		$("#train_add_error").html("地点不能为空!");
		return ;
	}
	if(tdate == ""){
		$("#train_add_error").html("日期不能为空!");
		return ;
	}
	if(ttime == ""){
		$("#train_add_error").html("时间不能为空!");
		return ;
	}
	$.ajax({
		url : "train/addTrain.sls",
		data : {"tcourse":tcourse,"tcher":tcher,"tstu":tstu,"tplace":tplace,"tdate":tdate,"ttime":ttime},
		type : "post",
		dataType : "json",
		success : function(result){
			if(result.status == 0){
				$("#train_add_error").html("信息添加成功！");
				setTimeout(function(){window.location.href="toTrain.sls";},1000);
			}else if(result.status == 1){
				$("#train_add_error").html("添加失败！");
			}else {
				$("#train_add_error").html("系统出错！");
			}
		},
		error : function(){
			window.location.href="error.sls";
		}
	});
	
}